import {$http} from '@escook/request-miniprogram';
import store from '@/store/store.js';

$http.baseUrl = 'https://www.uinav.com';

$http.beforeRequest=(options)=>{
	uni.showLoading({
		title:'数据加载中，请稍后'
	});
	// if(){
		
	// }
	console.log(options);
	if(options.url.indexOf('/my/') !== -1){
		options.header = {
			Authorization:store.state.user_m.token
		}
	}
};
$http.afterRequest=()=>{
	uni.hideLoading()
};
export default $http;